package com.example.opslog.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Author: Administrator
 * @Description:
 * @Date: Created in 2019-06-03 13:13
 * @Modified By:
 */
@Slf4j
@Async
@Component
public class OpsLogEventListener {


  @EventListener()
  public void opsListen(OpsApplicationEvent event) {

    log.info("事件线程名称: {}", Thread.currentThread().getName());

    log.info("发生事件，{}", event.getTimestamp());

  }
}
